<%@page import="java.util.Date" isELIgnored="false"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录</title>
    <link rel="stylesheet" href="layui-v2.8.4/layui/css/layui.css">
</head>

<body>
<!-- 登录页面 -->
<div class="page-container  ms-controller" style="display: flex; justify-content: center; align-items: center; height: 100vh;">
    <div>
        <img src="<%=request.getContextPath() %>/image/login.png" height="153" width="472">
        <div class="main_box">
            <div class="login_form">
                <div>
                    <% String tokenValue = new Date().getTime() +""; %>
                    <c:set value="<%=tokenValue %>" var="token" scope="session"/>
                </div>
                <form action="<%=request.getContextPath()%>/loginServlet" method="post">
                    <div>
                        <font color="RED">${sessionScope.message }</font>
                        <%session.removeAttribute("message"); %>
                    </div>
                    <table>
                        <tr>
                            <td>
                                <input type="hidden" name="token" value="<%=tokenValue %>"/><br>
                            </td>
                        </tr>
                        <tr>
                            <td>账号：</td>
                            <td>
                                <input type="text" name="username" value="${sessionScope.username}" lay-verify="required" placeholder="账号" autocomplete="off" class="layui-input" lay-affix="clear" required>
                                <br>
                            </td>
                        </tr>
                        <tr>
                            <td>密码：</td>
                            <td>
                                <input type="password" name="password" size="21" value="" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input" id="reg-password" lay-affix="eye" required>
                                <br>
                            </td>
                        </tr>
                        <tr>
                            <td>验证码：</td>
                            <td>
                                <input type="text" name="CHECK_CODE_PARAM_NAME" value="${sessionScope.username}" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input" lay-affix="clear" required>

                            </td>
                            <td>
                                <img alt="" src="<%= request.getContextPath() %>/validateColorServlet">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br>
                                <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login" type="submit" name="submit">登录</button>
                            </td>
                            <td>

                                <a href="findpassword.jsp" style="float: right; margin-top: 7px;">找回密码</a>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
    <script src="layui-v2.8.4/layui/layui.js"></script>
    <link type="text/css" rel="stylesheet" href="layui-v2.8.4/layui/css/layui.css"/>
</body>
</html>